package com.ryskoo.catering.producttag.repository;

import com.ryskoo.catering.constant.HCLCacheConstant;
import com.ryskoo.catering.producttag.domain.ProductTagPO;
import com.ryskoo.framework.core.repository.BasicRedisImpl;
import com.ryskoo.framework.core.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;

@Primary
@Repository
public class ProductTagRedisImpl extends BasicRedisImpl<ProductTagPO> implements IProductTagRepository{

    @Autowired
    private RedisUtil redisClient;

    @Autowired
    private IProductTagRepository productTagRepository;

    @PostConstruct
    public void init(){
        this.setDao(productTagRepository);
        this.setRedisClient(redisClient);
    }

    public ProductTagRedisImpl() { super (HCLCacheConstant.HCL_PRODUCTTAG_KEY);}
}
